package com.kotlin.usermodel.service.impl

import com.kotlin.baselibrary.rx.BaseFunction
import com.kotlin.usermodel.data.repository.UserRepository
import com.kotlin.usermodel.service.UserService
import io.reactivex.Observable
import javax.inject.Inject

/**
 * @author       zhipe
 * @createTime    2020/10/12
 * @description
 */
class UserServiceImpl @Inject constructor() : UserService {
    @Inject
    lateinit var repository: UserRepository

    override fun register(
        phoneNumber: String,
        verifyCode: String,
        pwd: String
    ): Observable<Boolean> {
        return repository.register(phoneNumber, pwd, verifyCode)
            .flatMap(BaseFunction<Boolean>())
    }
}